//
//  PracticeHeaderView.m
//  ZHIDOU
//
//  Created by 向礼 on 2018/12/21.
//  Copyright © 2018 向礼. All rights reserved.
//

#import "MyCourseHeaderView.h"
#import <SDCycleScrollView.h>
//#import <Masonry.h>

@interface MyCourseHeaderView()<SDCycleScrollViewDelegate>

//bannar 滚动图
@property (nonatomic, strong) SDCycleScrollView *sdCycleScrollView; // 广告

@end

@implementation MyCourseHeaderView

- (instancetype)initWithFrame:(CGRect)frame {
     if (self = [super initWithFrame:frame]) {
         [self setUpSubView];
     }
    return self;
}

- (void)setUpSubView
{
    self.backgroundColor = ZD_backgroundColor;
    [self addSubview:self.sdCycleScrollView];
    self.sdCycleScrollView.frame = CGRectMake(15, 15, self.width-30, self.height-26);
    self.sdCycleScrollView.localizationImageNamesGroup = @[@"ceishi",@"ceishi",@"ceishi"];
}

#pragma mark - lazy

- (SDCycleScrollView *)sdCycleScrollView {
    if (!_sdCycleScrollView) {
        _sdCycleScrollView = [SDCycleScrollView
                              cycleScrollViewWithFrame:CGRectZero
                              delegate:self
                              placeholderImage:[UIImage imageNamed:@"tianchong"]];
        _sdCycleScrollView.currentPageDotColor = [UIColor whiteColor];
        _sdCycleScrollView.pageDotColor = [UIColor colorWithWhite:1.0 alpha:0.5];
        _sdCycleScrollView.backgroundColor = [UIColor whiteColor];
    }
    return _sdCycleScrollView;
}

#pragma mark - SDCycleScrollViewDelegate

- (void)cycleScrollView:(SDCycleScrollView *)cycleScrollView didSelectItemAtIndex:(NSInteger)index {
//    if (_delegate && [_delegate respondsToSelector:@selector(mcHeaderView:didHandlerWithModel:isCycle:)]) {
//        MCIconModel *iconModel = self.model.bannerList[index];
//        iconModel.isActivity = YES;
//        [_delegate mcHeaderView:self didHandlerWithModel:iconModel isCycle:YES];
//    }
}


@end
